import random
seed,n = input().split()
seed = int(seed)
n = int(n)
random.seed(seed)
in_circle = 0
for i in range(n):
    x = random.uniform(-1,1)
    y = random.uniform(-1,1)
    if x**2 + y**2 <= 1:
        in_circle += 1
print(f"{in_circle / n * 4:.8f}")